<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>START TRANSACTION</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 9.1.2 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="SQL Commands"
HREF="sql-commands.html"><LINK
REL="PREVIOUS"
TITLE="SHOW"
HREF="sql-show.html"><LINK
REL="NEXT"
TITLE="TRUNCATE"
HREF="sql-truncate.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2011-12-01T22:07:59"></HEAD
><BODY
CLASS="REFENTRY"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="5"
ALIGN="center"
VALIGN="bottom"
><A
HREF="index.html"
>PostgreSQL 9.1.2 Documentation</A
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
TITLE="SHOW"
HREF="sql-show.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="sql-commands.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="20%"
ALIGN="right"
VALIGN="top"
><A
TITLE="TRUNCATE"
HREF="sql-truncate.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="SQL-START-TRANSACTION"
></A
>START TRANSACTION</H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN75904"
></A
><H2
>Name</H2
>START TRANSACTION&nbsp;--&nbsp;start a transaction block</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN75909"
></A
><H2
>Synopsis</H2
><PRE
CLASS="SYNOPSIS"
>START TRANSACTION [ <TT
CLASS="REPLACEABLE"
><I
>transaction_mode</I
></TT
> [, ...] ]

<SPAN
CLASS="phrase"
><SPAN
CLASS="PHRASE"
>where <TT
CLASS="REPLACEABLE"
><I
>transaction_mode</I
></TT
> is one of:</SPAN
></SPAN
>

    ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED }
    READ WRITE | READ ONLY
    [ NOT ] DEFERRABLE</PRE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN75914"
></A
><H2
>Description</H2
><P
>   This command begins a new transaction block. If the isolation level,
   read/write mode, or deferrable mode is specified, the new transaction has those
   characteristics, as if <A
HREF="sql-set-transaction.html"
>SET TRANSACTION</A
> was executed. This is the same
   as the <A
HREF="sql-begin.html"
>BEGIN</A
> command.
  </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN75919"
></A
><H2
>Parameters</H2
><P
>   Refer to <A
HREF="sql-set-transaction.html"
>SET TRANSACTION</A
> for information on the meaning
   of the parameters to this statement.
  </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN75923"
></A
><H2
>Compatibility</H2
><P
>   In the standard, it is not necessary to issue <TT
CLASS="COMMAND"
>START TRANSACTION</TT
>
   to start a transaction block: any SQL command implicitly begins a block.
   <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
>'s behavior can be seen as implicitly
   issuing a <TT
CLASS="COMMAND"
>COMMIT</TT
> after each command that does not
   follow <TT
CLASS="COMMAND"
>START TRANSACTION</TT
> (or <TT
CLASS="COMMAND"
>BEGIN</TT
>),
   and it is therefore often called <SPAN
CLASS="QUOTE"
>"autocommit"</SPAN
>.
   Other relational database systems might offer an autocommit feature
   as a convenience.
  </P
><P
>   The <TT
CLASS="LITERAL"
>DEFERRABLE</TT
>
   <TT
CLASS="REPLACEABLE"
><I
>transaction_mode</I
></TT
>
   is a <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> language extension.
  </P
><P
>   The SQL standard requires commas between successive <TT
CLASS="REPLACEABLE"
><I
>transaction_modes</I
></TT
>, but for historical
   reasons <SPAN
CLASS="PRODUCTNAME"
>PostgreSQL</SPAN
> allows the commas to be
   omitted.
  </P
><P
>   See also the compatibility section of <A
HREF="sql-set-transaction.html"
>SET TRANSACTION</A
>.
  </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN75941"
></A
><H2
>See Also</H2
><A
HREF="sql-begin.html"
>BEGIN</A
>, <A
HREF="sql-commit.html"
>COMMIT</A
>, <A
HREF="sql-rollback.html"
>ROLLBACK</A
>, <A
HREF="sql-savepoint.html"
>SAVEPOINT</A
>, <A
HREF="sql-set-transaction.html"
>SET TRANSACTION</A
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="sql-show.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="sql-truncate.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SHOW</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="sql-commands.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>TRUNCATE</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>